﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using Quizz.Infrastructure;
using Quizz.Library.Helper;
using Quizz.Library.QuizzServiceReference;

namespace Quizz.Library.Actions
{
    public class HomePageAction : BasicAction
    {
        public HomePageAction(System.Web.Mvc.Controller controller)
            : base(controller)
        {
        }

        public void ShowHomePage()
        {
            using(var proxy = new QuizzProjectServiceClient())
            {
                if (AccessFactory.IsUserLogined())
                {
                    ViewData[Constants.LastLoginLog] = proxy.LoginLogGetLastLogin(AccessFactory.CurrentUser.Id);
                }
            }
        }
    }
}
